package com.wk.unreal.dingroomserver.dto;

import lombok.Data;

import java.util.List;

@Data
public class Result<T> {

   private Integer code;
   private String message;
   private T data;

    // 成功
    public static Result success() {
        Result result = new Result();
        result.setCode(200);
        return result;
    }
    // 失败
    public static Result fail () {
        Result result = new Result();
        result.setCode(500);
        return result;
    }

    public Result code (Integer code) {
        this.code = code;
        return this;
    }

    public Result message (String message) {
        this.message = message;
        return this;
    }
    public Result data (T data) {
        this.data = data;
        return this;
    }

}
